<?php
abstract class HomeAction extends Action{
/**
     * 基类初始化操作
     */
    public function _initialize() {
    	$this->assign("inIndex", false);
    	$this->assign("bookStatusMap", array("连载","完结"));
    	
        $this->_hotWord();
        $this->_nav();
        $this->_links();
        $this->_announce();
        if(!C('site_status')){
            header('Content-Type:text/html; charset=utf-8');
            exit(C('site_close'));
        }
    }

    public function _hotWord(){
        $hotword = D("Keyword")->order('searchCount')->limit(5)->select();
        $this->assign("hotword",$hotword);
    }

    public function _nav(){
        $catList = D("Catalog")->order('sortIndex')->select();
        $catMap = array();
        foreach($catList as $cat){
        	$catMap[$cat["id"]] = $cat;
        }
        $this->assign("catMap",$catMap);
        $this->assign("catList",$catList);
    }
    
    public function _links(){
        /*$links = D("Links")->where(array('type'=>'0','status'=>'1'))->order('`order` desc')->select();
        $this->assign("links",$links);*/
    }
    
    public function _announce(){
        /*$where = array();
        $where['status'] = '1';
        $where['starttime'] = array('lt',  date("Y-m-d H:i:s"));
        $where['endtime'] = array('gt',  date("Y-m-d H:i:s"));
        $announce = D("Announce")->where($where)->order('`order` DESC')->select();
        //echo "<pre>";print_r(D("Announce")->getLastSql());exit;
        $this->assign("announce",$announce);*/
    }
}
